package com.sl.au.service.impl;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.springframework.stereotype.Service;

import com.sl.au.entity.EXDEThehosttostatisticsoffice;
import com.sl.au.service.EXDEThehosttostatisticsofficeService;
/**
 * 内勤-备件到款统计控制器ServiceImpl
 */
@Service("EXDEThehosttostatisticsofficeService")
public class EXDEThehosttostatisticsofficeServiceImpl extends BaseServiceImpl implements EXDEThehosttostatisticsofficeService{

	@PersistenceContext
	private EntityManager em;
	@SuppressWarnings("unchecked")
	@Override
	public List<EXDEThehosttostatisticsoffice> getPayDevice(String beginDate, String endDate, String type,String dept) {
		// TODO Auto-generated method stub
		System.out.println(beginDate+","+endDate+","+dept);
		Query query = this.em.createNativeQuery("{call Thehosttostatisticsoffice(?,?,?,?)}",EXDEThehosttostatisticsoffice.class);
		query.setParameter(1, beginDate);
		query.setParameter(2, endDate);
		query.setParameter(3, type);
		query.setParameter(4, dept);
		
		List<EXDEThehosttostatisticsoffice> users = query.getResultList();
		return users;
	}
	
}
